<?php
/**
 * Created by PhpStorm.
 * User: WX-C
 * Date: 2018/4/18
 * Time: 11:36
 */

namespace app\admin\controller;


use think\Controller;

class Base extends Controller
{
    protected $model;
    protected $noNeedLogin=['*'];
    public function _initialize()
    {
        $action=strtolower($this->request->action());
        if(in_array($action,$this->noNeedLogin)==false && is_null(session('userInfo'))){
            return $this->error('需要登录','admin/index/login');
        }
        parent::_initialize(); // TODO: Change the autogenerated stub
    }
}